home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_rollingboulder.cog < prev    next >
Text File  |  1999-11-15  |  19KB  |  747 lines

  1. # Jones 3D Cog Script
  2. #
  3. # PRU_rollingboulder.cog    Boulder chases Indy.
  4. #
  5. # [GGJ]    [MDR]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message        entered
  13. message        arrived
  14. message        touched
  15. message        startup
  16. message        timer
  17. message        blocked
  18. message        damaged
  19. message        pulse
  20. message        exited
  21.  
  22. thing        player        local
  23. thing        actor        local
  24. thing        boulder       
  25. thing        deadindy    nolink    local
  26. thing        floor7        
  27. thing        killCam        local
  28.  
  29. thing        branch         #mask=0x08
  30. thing        climbStrut0    #mask=0x08
  31. thing        climbStrut1    #mask=0x08
  32. thing        swingCam
  33. thing        climbCam
  34. thing        climbTarget
  35. thing        floorCam
  36. thing        wallBreakCam
  37. thing        boulderGhost
  38. thing        finaleGhost0
  39. thing        finaleGhost1
  40. thing        stopGhost
  41. thing        swingDeathActor
  42.  
  43. thing        ghost0
  44. thing        ghost1
  45. thing        ghost2
  46. thing        ghost3
  47. thing        ghost4
  48. thing        ghost5
  49. thing        ghost6
  50. thing        ghost7
  51. thing        ghost8
  52. thing        ghost9
  53. thing        ghost10
  54. thing        ghost11
  55. thing        ghost12
  56. thing        ghost13
  57. thing        ghost14
  58. thing        ghost15
  59. thing        ghost16
  60. thing        ghost17
  61. thing        ghost18
  62. thing        ghost19
  63. thing        ghost20
  64. thing        ghost21
  65. thing        ghost22
  66. thing        ghost23
  67. thing        ghost24
  68.  
  69. thing        block0            #top block on upstream side
  70. thing        block1            #upper middle block on upstream side
  71. thing        block2            #lower middle block on upstream side
  72. thing        block3            #bottom block on upstream side
  73. thing        block4            #downstream side, top
  74. thing        block5            #downstream side, upper middle
  75. thing        block6            #downstream side, lower middle
  76. thing        block7            #downstream side, bottom
  77.  
  78. thing        debrisGhost
  79. thing        fadePlate
  80. thing        smoke0            local
  81.  
  82. cog            fallingDebris0
  83. cog            fallingDebris1
  84. cog            fallingDebris2
  85. cog            fallingDebris3
  86. cog            fallingDebris4
  87. cog            fallingDebris5
  88. cog            fallingDebris6
  89. cog            adjoinSettings
  90.  
  91. template    debris0=stoneshrapa                    local
  92. template    debris1=stoneshrapb                    local
  93. template    debris2=stoneshrapc                    local
  94.  
  95. template    actortpl=indy_sh_actor                local
  96.  
  97. keyframe    smashed=in_die_buckle.key            local
  98. keyframe    roll=gen_boulder.key                local
  99. keyframe    pontificate=0in_figithat_4_4.key    local
  100. keyframe    in_handsONhips=0in_stand4.key            local
  101.  
  102. model        whipMod=weap_whip_hip.3do            local
  103.  
  104. sound        sndDie=tem_temspikes_up_kill_c.wav    local
  105. sound        floorfall=olv_fallfloor_c.wav        local
  106. sound        floorcrash=pru_boulder_crash_c.wav    local
  107. sound        rolling=pru_boulder_rolling_c.wav    local
  108. sound        tumble=pru_boulder_wallcrash_c.wav    local
  109. sound        dialogue=pu05j01.wav                local
  110. sound        musBoulder=mus_gen_danger2.wav        local
  111. sound        musSwing=mus_gen_indywhip1.wav        local
  112. sound        musClimb=mus_gen_indy_b_motif1.wav    local
  113.  
  114. template    tempRef=indy_sh_actor                local
  115. template    tempRefKill=ghost                    local
  116. template    smoketemplate=+bouldersmoke_spr                local
  117.  
  118. sector        bldrtrigger
  119. sector        musSector
  120.  
  121. surface        whipLand0
  122. surface        whipLand1
  123.  
  124. surface        climbLand0        linkID=1
  125. surface        climbLand1        linkID=1
  126. surface        climbLand2        linkID=1
  127.  
  128. surface        hangLedge0
  129. surface        hangLedge1
  130. surface        hangLedge2
  131. surface        slotSurf
  132.  
  133.  
  134. flex        rollspeed0=2.5        local        #The amount of TIME it takes to move to next target
  135. flex        rollspeed1=0.4        local
  136. flex        rollspeed2=0.5        local
  137. flex        rollspeed3=4.5        local
  138. flex        rollspeed4=1        local
  139. flex        rollspeed5=1        local
  140. flex        rollspeed6=4.5        local
  141. flex        rollspeed7=3        local
  142. flex        rollspeed8=3        local
  143. flex        rollspeed9=3        local
  144. flex        rollspeed10=1        local
  145. flex        rollspeed11=1        local 
  146. flex        rollspeed12=4.5        local       #was 1.5
  147. flex        rollspeed13=2        local
  148. flex        rollspeed14=1        local
  149. flex        rollspeed15=1        local
  150. flex        rollspeed16=2        local
  151. flex        rollspeed17=1        local
  152. flex        rollspeed18=6.5        local
  153. flex        rollspeed19=0.5        local
  154. flex        rollspeed20=0.75    local
  155. flex        rollspeed21=0.5        local
  156. flex        rollspeed22=0.5        local
  157. flex        rollspeed23=0.5        local
  158. flex        rollspeed24=0.5        local
  159.  
  160. flex        distanceFlex=0.0    local
  161. flex        angDelta=180        local
  162. flex        PosDelta=10            local
  163. flex        shakePercent        local
  164. flex        maxDistance=2.5        local
  165. flex        maxMultiplier        local
  166. flex        steamroller            local
  167. flex        swingdeath            local
  168.  
  169. int            frame=1                local
  170. int            once=0                local
  171. int            squished=0            local
  172. int            bouldersound=0        local
  173. int            boulderrollkey=0    local
  174. int            nPos=0                local
  175. int            nSyncToGhost=0        local
  176. int            fragment            local
  177. int            i                    local
  178. int            landed=0            local
  179. int            curCam                local
  180. int            climbing=0            local
  181. int            safe=0                local
  182. int            hanging=0            local
  183. int            in_keyTrack1        local
  184. int            in_keyTrack2        local
  185. int            collision            local
  186. int            musOnce=0            local
  187. int            indyUp=0            local
  188. int            victim                local
  189. int            macheteRemove=0        local
  190. int            slotStand=0            local
  191. int            swinging=0            local
  192. int            swingKill=0            local
  193. int            bldrFlags            local
  194.  
  195. vector        killCamUp            local
  196. vector        posOffset            local
  197. vector        angOffset            local
  198. vector        finalShot            local
  199.  
  200. end
  201.                                           
  202. # .................................................................................    
  203. code
  204. startup:
  205. player = GetLocalPlayerThing();
  206.  
  207. #maxMultiplier is used in pulse section.
  208. maxMultiplier=(1/maxDistance);
  209. collision = GetCollideType(boulder);
  210. ThingFadeAnim(fadePlate, 1, 0, 0.1, 0);
  211. return;
  212. # .................................................................................    
  213.  
  214. entered:
  215. if ((GetSenderRef() == musSector) && (musOnce == 0))
  216. {
  217.     musOnce=1;
  218.     PlaySoundLocal(musBoulder, 1.0, 0.0, 0x0, 0);
  219.     return;
  220. }
  221. if (GetSenderRef() == slotSurf)
  222. {
  223.     Print("entering bad surface");
  224.     slotStand = 1;
  225.     return;
  226. }
  227.  
  228.  
  229. #Indy triggers the rolling boulder.
  230. if ((GetSenderRef() == bldrtrigger) && (once == 0))
  231. {
  232.     once = 1;
  233.     
  234.     #Pulse operates camera shake.
  235.     SetPulse(0.1);
  236.     
  237.     MoveThingToPos(boulder, GetThingPos(ghost0), rollspeed0);
  238.     boulderrollkey = PlayKey(boulder, roll, 1, 0x0, 0);
  239.     bouldersound = PlaySoundThing(rolling, boulder, 1, 4.0, 75.0, 0x81);
  240. }
  241.  
  242. #When Indy jumps to safety on the last chunk of floor, remember that he's safe
  243. if ((GetSenderRef() == floor7) && (once == 1))
  244. {
  245.     safe = 1;
  246. }
  247.  
  248. #Indy lands after whipswinging.  The camera returns.
  249. if (((GetSenderRef() == whipLand0) || (GetSenderRef() == whipLand1)) && (landed == 0) && (swinging == 1))
  250. {
  251.     if (swingkill == 1)
  252.     {
  253.         ClearActorFlags(player, 0x200000);
  254.         EndCutscene();
  255.         PlaySoundLocal(sndDie, 1.0, 0.0, 0x0, 0);
  256.         DamageThing(player, 1000.0, 0x1, victim);
  257.         Sleep(2.0);
  258.         SetCurrentCamera(1);
  259.         return;
  260.     }
  261.     
  262.     landed = 1;
  263.     SetCurrentCamera(curCam);
  264.     #SetCameraFocus(curCam, player);
  265.     Swinging = 0;
  266.     ClearActorFlags(player, 0x200000);            #just in case...
  267.     EndCutscene();
  268. }
  269.  
  270. #Indy stops whip climbing.  The camera returns.
  271. if ((GetSenderID() == 1) && (climbing == 1))
  272. {
  273.     climbing = 0;
  274.     indyUp = 0;
  275.     SetCurrentCamera(curCam);
  276. }
  277.  
  278. #If Indy thinks he can outwit the boulder by hanging from the edge of the pit, he's wrong.
  279. if ((GetSenderRef() == hangLedge0) || (GetSenderRef() == hangLedge1) || (GetSenderRef() == hangLedge2))
  280. {
  281.     hanging=1;
  282. }
  283.  
  284. return;
  285.  
  286. # .................................................................................    
  287. exited:
  288.  
  289. if (GetSenderRef() == slotSurf)
  290. {
  291.     Print("leaving bad surface");
  292.     slotStand = 0;
  293.     return;
  294. }
  295.  
  296. if ((GetSenderRef() == floor7) && (once == 1))
  297. {
  298.     safe=0;
  299.     return;
  300. }
  301.  
  302. if ((GetSenderRef() == hangLedge0) || (GetSenderRef() == hangLedge1) || (GetSenderRef() == hangLedge2))
  303. {
  304.     hanging=0;
  305.     return;
  306. }
  307. return;
  308. # .................................................................................    
  309.     
  310. arrived:
  311. Print("arrived");
  312. if (GetSenderRef() == boulder)
  313. {
  314. #Boulder comes to a stop and the endlevel cutscene plays.
  315.     if (nPos == 24)
  316.     {
  317.         SetThingCollideSize(boulder, 0.10);
  318.         StopKey(boulder, boulderrollkey, 0);
  319.         SetPulse(0.0);
  320.         StopSound(bouldersound, 0.5);
  321.         PlaySoundThing(tumble, boulder, 1.0, -1, -1, 0);
  322.         
  323.         for(i=0; i<20; i=i+1)
  324.             {
  325.                 fragment = CreateThing(debris0[RandBetween(0, 2)], stopGhost);
  326.                 SetThingVel(fragment, VectorScale(VectorAdd(RandVec(), '-0.5 -0.5 0.05'), 2.0));
  327.                 SetThingRotVel(fragment, VectorScale(VectorAdd(RandVec(), '0.0 0.0 0.0'), 900.0));
  328.             }
  329.         smoke0 = CreateThing(smoketemplate, stopGhost);
  330.         AnimateSpriteSize(smoke0, '0.25 0.25 1.0', '0.75 0.75 0.0', 2.0);
  331.         if (indyUp == 0)
  332.             {
  333.                 squished = 1;
  334.                 call steamRoller;
  335.             }
  336.         
  337.         
  338.         if (squished != 1)
  339.         {
  340.             StartCutscene(1);
  341.             Sleep(2.5);
  342.             SetCameraSecondaryFocus(2, finaleGhost1);
  343.             
  344.             
  345.             SetCameraFOV(2, 70, 4.0);
  346.                 
  347.             SetThingFlags(player, 0x80000);       
  348.             SetActorFlags(player, 0x200000);
  349.             actor = CreateThing(actorTpl, finaleGhost0);
  350.             CaptureThing(actor);
  351.  
  352.             CopyPlayerHolsters(player, actor);
  353.             SetThingMesh(actor, 19, whipmod, 0);
  354.             ClearThingFlags(actor, 0x80000);
  355.             AISetCutsceneMode(actor);
  356.             AISetMoveSpeed(actor, 1.0);
  357.             AISetMoveThing(actor, finaleGhost1, 1);
  358.             Sleep(0.5);
  359.             in_keyTrack1 = PlayKey(actor, in_handsONhips, 2, 0x10, 0);
  360.             
  361.             in_keyTrack2 = PlayKey(actor, pontificate, 4, 0x12, 0);
  362.             
  363.             Sleep(1.5);
  364.             
  365.             StopKey(actor, in_keyTrack1, 0.5);
  366.             StopKey(actor, in_keyTrack2, 0.5);
  367.             Sleep(0.5);
  368.             
  369.             PlayVoice(actor, dialogue, 1, 1);
  370.             Sleep(1.0);
  371.             ThingFadeAnim(fadePlate, 0, 1, 2.0, 0);
  372.             
  373.             Sleep(3.0);
  374.             EndCutscene();
  375.             SetSwimmingInventory(player, 1);
  376.             JonesEndLevel();
  377.         }
  378.         return;
  379.     }
  380.   
  381.     #position of boulder along ghost objects.
  382.     nPos = nPos + 1;
  383.     
  384.     
  385.     MoveThingToPos(boulder, GetThingPos(ghost0[nPos]), rollspeed0[nPos]);
  386.         
  387.         #User messages cause debris to fall.
  388.         if (nPos == 1)
  389.         {
  390.             SendMessage(fallingDebris0, user0);
  391.         }
  392.         if (nPos == 3)
  393.         {
  394.             SendMessage(fallingDebris0, user1);
  395.             SendMessage(fallingDebris1, user0);
  396.         }
  397.         
  398.         #Boulder passes over the last chunk of floor, causing it to start to fall.
  399.         if (nPos == 4)
  400.         {
  401.             SendMessage(fallingDebris1, user1);
  402.             SendMessage(fallingDebris2, user0);
  403.             
  404.             #Cut to camera if the player is safely standing on the block.
  405.             if ((safe == 1) && (squished == 0))
  406.             {
  407.                 SetActorFlags(player, 0x200000);
  408.                 StartCutscene(0);
  409.                 MakeMeStop();
  410.                 Sleep(0.5);
  411.                 if (GetCurItem(player) != 2)
  412.                 {
  413.                     DeselectWeaponWait(player);
  414.                 }
  415.                 
  416.                 
  417.                 actor = CreateThing(actorTpl, player);
  418.                 CaptureThing(actor);
  419.                 
  420.                 CopyPlayerHolsters(player, actor);
  421.                 SetThingFlags(player, 0x80000);
  422.                 SetActorFlags(player, 0x200000);
  423.                 ClearThingFlags(actor, 0x80000);
  424.                 ResetThing(player);
  425.             
  426.                 curCam = GetCurrentCamera();
  427.                 SetCameraLookInterp(2, 0);
  428.                 SetCameraPosInterp(2, 0);
  429.                 SetCameraFocus(2, floorCam);
  430.                 SetCameraSecondaryFocus(2, boulder);
  431.                 SetCurrentCamera(2);
  432.                 SetCameraFOV(100, 0, 0.0);
  433.                 return;
  434.             }
  435.             if (safe == 0)
  436.             {
  437.                 call steamRoller;
  438.                 return;
  439.             }
  440.         }
  441.         
  442.         #return the camera.
  443.         if ((nPos == 6) && (safe == 1))
  444.         {
  445.             Sleep(0.75);
  446.             SetCurrentCamera(curCam);
  447.             ResetCameraFOV(0, 0.0);
  448.             ClearThingFlags(player, 0x80000);
  449.             ClearActorFlags(player, 0x200000);
  450.             SetThingFlags(actor, 0x80000);
  451.         
  452.             SendMessage(fallingDebris2, user1);
  453.             ChangeSoundVol(boulderSound, 0.1, 2.0);
  454.             
  455.             MoveToFrame(floor7, 3, 5.0);
  456.             PlaySoundThing(floorfall, floor7, 1.0, -1.0, -1.0, 0x0);
  457.             SetTimer(2.5);
  458.             EndCutscene();
  459.         }
  460.         
  461.         if (nPos == 8)
  462.         {
  463.             // Rotate boulder 180 degrees
  464.             SetThingLook( boulder, VectorSub('0 0 0', GetThingLVec(boulder)) );
  465.             ChangeSoundVol(boulderSound, 1, 1.0);
  466.             
  467.     
  468.         }
  469.         if (nPos == 10)
  470.         {
  471.             SendMessage(fallingDebris2, user0);
  472.         }
  473.         
  474.         if (nPos == 11)
  475.         {
  476.             if (hanging == 1)
  477.             {
  478.                 SetActorFlags(player, 0x200000);
  479.                 DetachThing(player);
  480.                 hanging == 0;
  481.             }
  482.             if (slotStand == 1)
  483.             {
  484.                 Call SteamRoller;
  485.             }
  486.         }
  487.         if (nPos == 12)
  488.         {
  489.             SendMessage(fallingDebris2, user1);
  490.             SendMessage(fallingDebris1, user0);
  491.         }
  492.         
  493.         
  494.         if (nPos == 13)
  495.         {
  496.             SendMessage(fallingDebris1, user1);
  497.             SendMessage(fallingDebris0, user0);
  498.         }
  499.             
  500.         if (nPos == 15)
  501.         {
  502.             SendMessage(fallingDebris0, user1);
  503.             SendMessage(fallingDebris3, user0);
  504.         }
  505.         
  506.         if (nPos == 18)
  507.         {
  508.             SendMessage(fallingDebris3, user1);
  509.             SendMessage(fallingDebris4, user0);
  510.                 
  511.             Sleep(1.0);
  512.             if (swinging == 1)
  513.             {
  514.                 call SteamRoller;
  515.             }
  516.             Sleep(0.5);
  517.  
  518.             SendMessage(fallingDebris4, user1);
  519.             SendMessage(fallingDebris5, user0);
  520.             
  521.             
  522.             
  523.             Sleep(1.5);
  524.             SendMessage(fallingDebris5, user1);
  525.             SendMessage(fallingDebris6, user0);
  526.         }
  527.             
  528.         #Boulder crashes through the wall.
  529.         if (nPos == 19)
  530.         {
  531.             SendMessage(fallingDebris6, user1);
  532.             SendMessage(adjoinSettings, user0);
  533.             DestroyThing(block0);
  534.             DestroyThing(block1);
  535.             DestroyThing(block2);
  536.             DestroyThing(block3);
  537.             DestroyThing(block4);
  538.             DestroyThing(block5);
  539.             DestroyThing(block6);
  540.             DestroyThing(block7);
  541.             
  542.             PlaySoundLocal(tumble, 1.0, 0.0, 0x0, 0);
  543.                 
  544.             if (indyup != 1)
  545.             {
  546.                 Sleep(1.0);
  547.             }
  548.             
  549.             SetCollideType(boulder, 0);
  550.             if (squished != 1)
  551.             {
  552.                 StartCutscene(1);
  553.                 SetThingFlags(player, 0x80000);
  554.                 SetCameraFocus(2, wallbreakCam);
  555.                 SetCameraSecondaryFocus(2, boulderGhost);
  556.                 SetCurrentCamera(2);
  557.                 ResetCameraFOV(0, 0.0);
  558.                 MoveToFrame(boulderGhost, 1, 5.0);
  559.                 PlaySoundLocal(musClimb, 1.0, 0.0, 0x0, 0);
  560.             }
  561.                 
  562.             smoke0 = CreateThing(smoketemplate, debrisGhost);
  563.             AnimateSpriteSize(smoke0, '0.5 0.5 0.75', '1.75 1.75 0.0', 2.0);
  564.             for(i=0; i<40; i=i+1)
  565.             {
  566.                 fragment = CreateThing(debris0[RandBetween(0, 2)], debrisGhost);
  567.                 SetThingVel(fragment, VectorScale(VectorAdd(RandVec(), '-0.5 -0.5 0.05'), 2.0));
  568.                 SetThingRotVel(fragment, VectorScale(VectorAdd(RandVec(), '0.0 0.0 0.0'), 900.0));
  569.             }
  570.         }
  571.         
  572.         if (nPos == 21)
  573.         {
  574.             SetCollideType(boulder, collision);
  575.             bldrFlags = GetPhysicsFlags(boulder);
  576.             bitSet(bldrFlags, 0x1);
  577.             SetPhysicsFlags(boulder, bldrFlags);
  578.             MoveToFrame(wallBreakCam, 1, 2.5);
  579.         }
  580.         
  581. }                                         
  582. #The last chunk of floor falls and crashes.    
  583. if ((GetSenderRef() == floor7) && (GetCurFrame(floor7) == 4))
  584. {
  585.     PlaySoundThing(floorcrash, floor7, 1.0, -1.0, -1.0, 0x0);
  586. }
  587. return;
  588. # .................................................................................    
  589.  
  590. touched:
  591. #Boulder hits Indy, killing him.
  592. if ((GetSenderRef() == boulder) && (GetSourceRef() == player) && (squished == 0))
  593. {
  594.     call steamRoller;            
  595. }
  596. return;
  597. # .................................................................................    
  598.  
  599. timer:
  600.  
  601. #The last chunk of floor falls free.
  602. MoveToFrame(floor7, 4, 20.0);
  603. return;
  604. # .................................................................................    
  605.  
  606. blocked:
  607. Print("blocked");
  608. #MoveThingToPos(boulder, GetThingPos(ghost0[nPos-nSyncToGhost]), rollspeed0[nPos]);
  609. return;
  610. # .................................................................................    
  611.  
  612. damaged:
  613. #Damage must be caused by whip.    
  614. if (GetParam(1) != 0x10) return;
  615.     
  616. #Cut to other camera if Indy whipswings across gap.
  617. if (GetSenderRef() == branch)
  618. {
  619.     swinging = 1;
  620.     StartCutscene(0);
  621.     curCam = GetCurrentCamera();
  622.     SetCameraLookInterp(2, 0);
  623.     SetCameraPosInterp(2, 0);
  624.     ResetCameraFOV(0, 0.0);
  625.     SetCameraFocus(2, swingCam);
  626.     SetCameraSecondaryFocus(2, player);
  627.     SetCurrentCamera(2);
  628.     Sleep(1.5);
  629.     PlaySoundLocal(musSwing, 1.0, 0.0, 0x0, 0);
  630. }
  631.  
  632. #Cut to other camera if Indy whip climbs.
  633. if ((GetSenderRef() == climbStrut0) || (GetSenderRef() == climbStrut1))
  634. {
  635.     indyUp = 1;
  636.     curCam = GetCurrentCamera();
  637.     climbing = 1;
  638.     ResetCameraFOV(0, 0.0);
  639.     SetCameraFocus(2, climbCam);
  640.     SetCameraSecondaryFocus(2, climbTarget);
  641.     SetCurrentCamera(2);
  642.     SetCameraFOV(100, 0, 0.0);
  643.     Sleep(1.5);
  644.     #PlaySoundLocal(musClimb, 1.0, 0.0, 0x0, 0);
  645. }
  646. return;
  647.  
  648. # .................................................................................    
  649. pulse:
  650.  
  651. #Find the distance between the player and the boulder.
  652. distanceFlex=VectorDist(GetThingPos(boulder), GetThingPos(player));
  653.  
  654. if (hanging == 1) 
  655. {
  656.     #If Indy is hanging when the player passes overhead, he falls.
  657.     if (distanceFlex < .4)
  658.     {
  659.         SetActorFlags(player, 0x200000);
  660.         DetachThing(player);
  661.         hanging == 0;
  662.         Print("     You thought you were smart, didn't you?");
  663.     }
  664. }
  665.  
  666. #Raise the distance to the maximum level if it is lower.
  667. if (distanceFlex > maxdistance)
  668. {
  669.     distanceFlex = maxdistance;
  670. }
  671.     
  672. #Calculate what percentage the actual distance is of the maximum distance
  673. shakePercent = 1.1 - (distanceFlex * maxMultiplier);
  674.  
  675. #Shake the camera, based on the percentage of distance.
  676. posOffSet = VectorScale(VectorSet(RandBetween(-1, 1), RandBetween(-1, 1), RandBetween(-1, 1)), shakepercent * 0.0025);
  677. angOffSet = VectorScale(VectorSet(RandBetween(-1, 1), RandBetween(-1, 1), RandBetween(-1, 1)), shakepercent * 0.025);
  678.  
  679. SetPOVShake(posOffSet, angOffSet, posDelta, angDelta);
  680.  
  681. return;
  682.  
  683. # .................................................................................    
  684. steamRoller:
  685. if (BITTEST(GetThingFlags(player), 0x202))
  686.     return;            // Indy is already dead or dying - let the normal death cam do its job.
  687.  
  688. if (squished == 1) return;
  689.  
  690. squished=1;    
  691. #    PrintVector(GetThingPos(boulder));
  692.     
  693. killCam = CreateThing(tempRefKill, boulder);
  694.         
  695. killCam = CreateThingAtPos
  696. (tempRefKill, GetThingSector(boulder), VectorAdd(GetThingPos(boulder), '0 0 0.1'), '0 0 0');
  697.     
  698. CaptureThing(killCam);
  699. #    PrintVector(GetThingPos(killCam));
  700. SetCollideType(killCam, 0);
  701.     
  702. //killCamUp = GetThingPos(killCam);
  703. //PrintInt(killCamUp);
  704. //VectorAdd(killCamUp, '0.0 0.0 1.0');
  705. //SetThingPos(killCam, killCamUp);
  706.  
  707. DamageThing(player, 1000.0, 0x1, victim);
  708. Sleep(0.1);
  709. if (swinging == 0)
  710. {
  711.     PlaySoundLocal(sndDie, 1.0, 0.0, 0x0, 0);
  712. }
  713. if (swinging == 1)
  714. {
  715.     swingKill = 1;
  716.     call SwingDeath;
  717. }
  718. #SetThingFlags(player, 0x80000);
  719. #deadIndy = CreateThing(tempRef, player);
  720. #CaptureThing(deadIndy);
  721.  
  722. #ClearThingFlags(deadindy, 0x80000);
  723.  
  724. SetCameraFocus(2, killCam);
  725. SetCameraSecondaryFocus(2, player);
  726. SetCurrentCamera(2);
  727.  
  728. #PlayKey(deadindy, smashed, 4, 0x14, 0);
  729. Sleep(0.75);
  730. SetCollideType(boulder, 0);
  731. StopSound(boulderSound, 3.0);
  732. return;
  733.  
  734.  
  735.  
  736. SwingDeath:
  737.  
  738. SetThingFlags(player, 0x10);
  739. CopyPlayerHolsters(player, swingDeathActor);
  740. ClearthingFlags(swingDeathActor, 0x80000);
  741. PlayKey(swingDeathActor, smashed, 4, 0x14, 0);
  742.  
  743. return;
  744.  
  745. end
  746.  
  747.